main(n,l,v,s)
{
	int r[20];
	float a,t,i;
	for(gets(&n);~scanf("%d",&n);printf("%d\n",r[v]))
	{
		for(s=l=0;l<n;s+=r[l++])scanf("%d",&r[l]);
		for(a=1.*s/n,l=0,i=10000;l<n;l++)
		{
			t=fabs(a-r[l]*1.);
			if(i>t)
			{
				i=t;
				v=l;
			}
		}
	}
}
